import request from '@/utils/request'
import requestNew from "@/utils/requestNew";

// 查询【请填写功能名称】列表
export function listBudgetFundsOut(query) {
  return request({
    url: '/distribution/distribution/list',
    method: 'get',
    params: query
  })
}
// 操作日志
export function operationLog(query) {
  return request({
    url: '/distribution/operationLog/list',
    method: 'get',
    params: query
  })
}

// 批次发放--银行支付状态查询
export function queryBatchBankRst(data) {
  return requestNew({
    url: '/distribution/distribution/queryBatchBankRst',
    method: 'POST',
    data: data
  })
}

// 新增金额汇总
export function statisMoneyForAdd(query) {
  return request({
    url: '/distribution/distribution/statisMoneyForAdd',
    method: 'get',
    params: query
  })
}

export function statisMoneyForApprove(query) {
  return request({
    url: '/distribution/distribution/statisMoneyForApprove',
    method: 'get',
    params: query
  })
}

// 资金预算发送短信
export function sendSmsVerifyCode(data) {
  return request({
    url: '/distribution/distribution/sendSmsVerifyCode',
    method: 'POST',
    data: data
  })
}

// 新建批次
export function newCpsDistribution(data) {
  return request({
    url: '/distribution/distribution/newCpsDistribution',
    method: 'POST',
    data: data
  })
}

//验证批次是否存在小于当前百分比
export function checkForNewCpsDistribution(data) {
  return request({
    url: '/distribution/distribution/checkForNewCpsDistribution',
    method: 'POST',
    data: data
  })
}

export function checkForUpdateCpsDistribution(data) {
  return request({
    url: '/distribution/distribution/checkForUpdateCpsDistribution',
    method: 'POST',
    data: data
  })
}

export function distributionSubmit(data) {
  return request({
    url: '/distribution/distribution/cpsDistributionSubmit',
    method: 'POST',
    data: data
  })
}

// 资金预算验证短信密码
export function verifySmsVerifyCode(data) {
  return requestNew({
    url: '/distribution/distribution/verifySmsVerifyCode',
    method: 'POST',
    data: data
  })
}

export function queryPay(orderNumber) {
  return requestNew({
    url: '/distribution/item/queryPay/' + orderNumber,
    method: 'get',
  })
}

// 批次明细
export function getdistribution(query) {
  return request({
    url: '/distribution/distribution/getInfo',
    method: 'get',
    params: query
  })
}

export function distributionExport(query) {
  return request({
    url: '/distribution/item/export',
    method: 'get',
    params: query
  })
}

//审核功能查询明细
export function subApprovalOutList(data, pageNum, pageSize) {
  return request({
    url: '/distribution/item/subApprovalList?pageNum=' + pageNum + "&pageSize=" + pageSize,
    method: 'post',
    data: data
  })
}

export function approvalMoneyOut(data) {
  return request({
    url: '/distribution/item/approvalMoney',
    method: 'post',
    data: data
  })
}

export function certificate(data) {
  return request({
    url: '/distribution/distribution/certificate',
    method: 'post',
    data: data
  })
}

//批次明细
export function mxListOut(data) {
  return request({
    url: '/distribution/item/mxList',
    method: 'get',
    params: data
  })
}

//批次明细- （审批--明细）、批次明细
export function paymentItem(data) {
  return request({
    url: '/distribution/paymentItem/list',
    method: 'get',
    params: data
  })
}

// 审核记录
export function approvalOutList(data) {
  return request({
    url: '/distribution/approval/list',
    method: 'get',
    params: data
  })
}

export function operationLogList(data) {
  return request({
    url: '/distribution/operationLog/list',
    method: 'get',
    params: data
  })
}

export function distribution(data) {
  return requestNew({
    url: '/distribution/distribution/distribution',
    method: 'post',
    data: data
  })
}

// 查询资金发放汇总金额
export function totalMoney(data) {
  return request({
    url: '/distribution/item/totalMoney',
    method: 'post',
    data: data
  })
}

// 审批
export function approvalOut(data) {
  return request({
    url: '/distribution/approval/add',
    method: 'post',
    data: data
  })
}

// 资金台账
export function listStatis(query) {
  return request({
    // url: '/distribution/item/listStatis',
    url: '/distribution/paymentItem/payList',
    // url: '/distribution/paymentItem/list',
    method: 'get',
    params: query
  })
}

export function listStatisDetail(query) {
  return request({
    url: '/distribution/item/listStatisDetail',
    method: 'get',
    params: query
  })
}

export function addBudgetFundsOut(data) {
  return request({
    url: '/distribution/distribution/add',
    method: 'post',
    data: data
  })
}

export function updateBudgetFundsOut(data) {
  return request({
    url: '/distribution/distribution/',
    method: 'put',
    data: data
  })
}

export function getSubList(query) {
  return request({
    url: '/distribution/item/subList',
    method: 'get',
    params: query
  })
}

//资金待发放列表
export function paymentList(query) {
  return request({
    url: '/distribution/payment/list',
    method: 'get',
    params: query
  })
}

//批次新建前的统计
export function statisForAdd(query) {
  return request({
    url: '/distribution/distribution/statisForAdd',
    method: 'get',
    params: query
  })
}

// 查询【请填写功能名称】详细
export function getBudgetFundsOut(id) {
  return request({
    url: '/system/BudgetFundsOut/' + id,
    method: 'get'
  })
}

// 删除【请填写功能名称】
export function delBudgetFundsOut(id) {
  return request({
    url: '/distribution/distribution/' + id,
    method: 'delete'
  })
}

// 导出【请填写功能名称】
export function exportBudgetFundsOut(query) {
  return request({
    url: '/system/BudgetFundsOut/export',
    method: 'get',
    params: query
  })
}
